# cronmon - Cron e-mail filtering and management
# Copyright (c) 2010 Crown copyright
# 
# This file is part of cronmon.
# 
# cronmon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# cronmon is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with cronmon.  If not, see <http://www.gnu.org/licenses/>.

from django.conf.urls.defaults import *
from django.conf import settings

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', 'cronmon.cron.views.todays_messages', name='todays-messages'),
    url(r'^new$', 'cronmon.cron.views.new_messages', name='new-messages'),
    url(r'^critical$', 'cronmon.cron.views.critical_messages', name='critical-messages'),
    url(r'^warning$', 'cronmon.cron.views.warning_messages', name='warning-messages'),
    url(r'^host/$', 'cronmon.cron.views.all_hosts', name='all-hosts'),
    url(r'^tag/$', 'cronmon.cron.views.all_tags', name='all-tags'),
    url(r'^host/(?P<hostname>[\w.-]+)/$', 'cronmon.cron.views.by_host', name='cron-by-host'),
    url(r'^tag/(?P<tag>[\w-]+)/$', 'cronmon.cron.views.by_tag', name='cron-by-tag'),
    url(r'^messages/(?P<id>\d+)/$', 'cronmon.cron.views.message', name='message'),
    url(r'^messages/(?P<id>\d+)/discard$', 'cronmon.cron.views.discard_message', name='discard-message'),
    url(r'^messages/(?P<messageid>\d+)/escalate$', 'cronmon.cron.views.escalate_message', name='escalate-message'),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    (r'^admin/', include(admin.site.urls)),
    (r'^assets/(.*)', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)
